package com.demo.model.nengyuanshujicaiji;

import com.demo.model.BaseModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

//能源数据采集实体类
@Data
public class nengyuanshujicaiji extends BaseModel {

    //id
    private Integer id;

    //设备名称
    private String deviceName;

    //已产数量
    private Integer quantityProduced;

    //单位耗电数
    private Integer unitPowerConsumption;

    //总耗电量
    private BigInteger totalPowerConsumption;

    //单位碳排放
    private BigDecimal unitCarbonEmission;

    //总碳排放
    private BigDecimal totalCarbonEmissions;

    //@JsonFormat是jackson包里面的注解，作用是从后台向前台传递日期值；
    //@DateTimeFormat是spring包里面的注解，作用是接收从页面传到后台的日期值；
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //开始日期
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    //结束日期
    private Date endTime;
}
